# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=radeontop
pkgver=1.4
pkgrel=2
pkgdesc="View GPU utilization for total activity percent and individual blocks"
arch=(loong64 x86_64)
url="https://github.com/clbr/radeontop"
license=(GPL3)
depends=(
  glibc
  libdrm
  libpciaccess
  libxcb
  ncurses
)
makedepends=(
  xorgproto
)
source=($url/archive/v$pkgver/$pkgname-v$pkgver.tar.gz)
sha512sums=('078087929bdbcf9b131d78f5ab0adc3d086be168d376d9f8e27a886668764263b072e0b08cb4dde593284fcdd16faa44711125c2ea5a14aaad70c8fa0f57f2b9')
b2sums=('ad8893f491442c06f91c2a7bcf9cf884f066bb4fb01be019afbaa8e604ca12355647c624efa0742b15cb99e00fddbf71fa5b75f34086139acf0779c72668b354')

prepare() {
  cd $pkgname-$pkgver
  # set version
  sed -e "s/unknown/$pkgver/" -i getver.sh
  ./getver.sh
}

build() {
  make -C $pkgname-$pkgver
}

package() {
  make DESTDIR="$pkgdir/" install -C $pkgname-$pkgver
  install -vDm 644 $pkgname-$pkgver/README.md -t "$pkgdir/usr/share/doc/$pkgname/"
}
